<template>
  <div>
    <el-input
      placeholder="请输入用户名"
      v-model="input"
      clearable>
    </el-input>
    <el-input placeholder="请输入密码" v-model="password" show-password></el-input>
    <el-button @click="login">提交</el-button>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        input: '',
        password:''
      }
    },
    methods:{
      login(){
        if(this.input.trim()==''){
          alert("UserName is not null");
          return;
        }
        else if(this.password.trim()==''){
          alert()
        }
        this.$post("user/login",{UserName:this.input}).then(res=>{
            alert(res)
        })
      }
    }
  }
</script>

<style>
</style>
